/**
 * 
 */
package org.swing.utility.common.datetime;

import org.joda.time.DateTime;
import org.swing.utility.common.imp.DateTimeDuration;

/**
 * @author lqnhu
 *
 */
public class DateTimeHour extends DateTimePeriod {
	protected DateTimeHour(DateTime start, DateTime end) {
		super(start, end, DateTimeDuration.HOUR, "yyyy-MM-dd-HH",
				"MMMM d, yyyy HH:00", "HH:00", "HH");
	}

	@Override
	public DateTimePeriod getNext() {
		DateTime next = getStart().plusHours(1);
		return DateTimePeriod.createHour(next);
	}

	@Override
	public DateTimePeriod getPrevious() {
		DateTime previous = getStart().minusHours(1);
		return DateTimePeriod.createHour(previous);
	}

	@Override
	public DateTimeDuration getDefaultSubDuration() {
		return DateTimeDuration.FIVE_MINUTES;
	}
}
